package test2;

public class Main {
    public static void main(String[] args) {
        Phone[] arr = new Phone[3];

        Phone phone1 = new Phone("小米","14","玫红",4300);
        Phone phone2 = new Phone("苹果","15","蓝色",8999);
        Phone phone3 = new Phone("华为","pura70","蓝色",5499);

        arr[0] = phone1;
        arr[1] = phone2;
        arr[2] = phone3;

        int sum = 0,avg=0;
        for (int i = 0; i < arr.length; i++) {
            sum=sum+arr[i].getPrice();

        }
        avg=sum/arr.length;
        System.out.println(avg);

    }
}
